# import random

# try:
#     fruit = random.choice(['apple', 'pear', 'banana'])
#     print(f"随机选择的水果是: {fruit}")
# except IndexError as e:
#     print(f"选择水果时发生错误: {e}")

# try:
#     numbers = random.sample(range(100), 10)   # sampling without replacement
#     print(f"随机选择的10个不重复的数字是: {numbers}")
# except ValueError as e:
#     print(f"选择数字时发生错误: {e}")

# random_float = random.random()    # random float
# print(f"随机生成的浮点数是: {random_float}")

# random_integer = random.randrange(6)    # random integer chosen from range(6)
# print(f"随机生成的整数是: {random_integer}")
